var hello = '我又来了';
console.log(hello);
function add2(n1, n2) {
    return n1 + n2;
}
console.log(add2(1, 2));
var total = 0;
var list1 = [1, 2, 3];
var list2 = [1, 2, 3];
var list3 = [1, 2, 3];
var person1; //元组  Tupple
person1 = [1, '2'];
// 联合(Union)类型
var union;
//字面量(Literal类型 
var literal;
literal = 3;
console.log(literal);
// 枚举
var Color;
(function (Color) {
    Color[Color["blue"] = 2] = "blue";
    Color[Color["green"] = 3] = "green";
    Color[Color["red"] = 4] = "red";
})(Color || (Color = {}));
var color = Color.blue;
console.log(color);
// any与unknow类型
var randomValue = 666;
randomValue = '444';
randomValue = {};
console.log(randomValue);
//void undefined 与never
function whileLoop() {
    while (true) {
        console.log('哈哈哈');
    }
}
// whileLoop() //死循环
// 类型适配(类型断言)
// let message:any;
// message='abc'
// message.endWith('c');
// let ddd=(<string>message).endsWith('c')
// 函数类型
var log3 = function (message, code) {
    console.log(message, code); //hello undefined
};
log3('hello');
var log2 = function (message, code) {
    if (code === void 0) { code = 0; }
    console.log(message, code); //hello undefined
};
log2('hello');
log2('hello', 3);
